package io.geekidea.boot.area.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.geekidea.boot.area.entity.Area;
import io.geekidea.boot.area.entity.ImportArea;
import io.geekidea.boot.area.mapper.AreaMapper;
import io.geekidea.boot.area.query.AreaQuery;
import io.geekidea.boot.area.service.AreaService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements AreaService {

    @Resource
    private AreaMapper areaMapper;

    @Override
    public Boolean delById(Integer id) {
        return areaMapper.delByIdInt(id)>0;
    }

    @Override
    public List<Area> getList(Area area) {
        return areaMapper.getList(area);
    }

    @Override
    public List<ImportArea> getDownloadAreaList(AreaQuery areaQuery) {
        return areaMapper.getDownloadAreaList(areaQuery);
    }
}
